Texture InputTexture;
Texture DiffTexture;

sampler inputTexture = sampler_state 
{ 
    texture = <InputTexture>; 
    magfilter = LINEAR; 
    minfilter = LINEAR; 
    mipfilter = LINEAR; 
};

sampler diffTexture = sampler_state 
{ 
    texture = <DiffTexture>; 
    magfilter = LINEAR; 
    minfilter = LINEAR; 
    mipfilter = LINEAR; 
};
 
struct VS_OUTPUT
{
	float4 Position	: POSITION;
	float2 TexCoords : TEXCOORD0;
};
 
float4 Diff_PS (VS_OUTPUT Input) : COLOR0
{
	float4 color = tex2D(inputTexture, Input.TexCoords);
	float4 diff_color = tex2D(diffTexture, Input.TexCoords);
	
	float4 result = color - diff_color;
	result.a = 1.0;
	
	return result;
}
 
technique Diff
{
	pass P0
	{
		PixelShader = compile ps_2_0 Diff_PS();
	}
}